package game.editer;

import game.utils.FileSystem;
import electron.remote.Dialog;
import lime.ui.FileDialog;
import hx.events.Event;
import hx.layout.AnchorLayoutData;
import hx.display.ArrayCollection;
import game.editer.ui.DownDropListView;
import hx.display.HBox;
import game.editer.view.*;

class MainMenu extends BasePanel {
	public function new() {
		super("ActBuilderNext");
	}

	override function onInit() {
		super.onInit();

		var hbox = new HBox();
		hbox.gap = 5;
		this.addChild(hbox);
		hbox.layoutData = AnchorLayoutData.middleLeft(0, 110);

		var tools = new DownDropListView();
		tools.enableIcon = false;
		tools.text = "工具";
		tools.width = 90;
		tools.data = new ArrayCollection([{text: "切割精灵图"}, {text: "暂定代码区"}, {text: "暂定"}]);

		// hbox.addChild(tools);
	}

	private function openPropject():Void {
		FileSystem.openFile({
			filters: [
				{
					name: "*.abproj",
					extensions: ["abproj"]
				}
			]
		}, (path:FileEvent) -> {
			trace("选择的文件", path);
			EditerStage.current.openABProject(path.filePaths[0]);
		});
	}
}
